#include <gl\glew.h>
#include <gl\freeglut.h>
#include <iostream>

float colorIncrement = 0;

void MainLoop (void) 
{  
	glClearColor(colorIncrement/100.0, 0, colorIncrement/100.0, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT);
	glLoadIdentity();
  
	colorIncrement+=0.2;
	if(colorIncrement >= 100.0)
	{
		colorIncrement = 0;
	}

	std::cout<<colorIncrement<<std::endl;	

	glutSwapBuffers();
}  
  
int main (int argc, char **argv) 
{  
	glutInit(&argc, argv);
	glutInitDisplayMode (GLUT_DOUBLE);
	glutInitWindowSize (500, 500);
	glutInitWindowPosition (100, 100);
	glutCreateWindow ("Your first OpenGL Window");
  
	glutDisplayFunc(MainLoop);
	glutIdleFunc(MainLoop);
  
	glutMainLoop();
	
	return 0;
}  